import request from '@/utils/request'
/**
 *
 * 获取组织架构数据
 *
*/
// 1.封装获取组织API
export function getDepartment() {
  return request({
    url:"/company/department"
  })

}

/**
 * 获取部门负责列表
 * @returns {*}
 */
export function getmanagerList(){
  return request({
    url:"/sys/user/simple"
  })
}

/**
 * 添加部门数据
 * @param data
 * @returns {AxiosPromise}
 */
export function addDepartment(data){
  return request({
    url:"/company/department",
    method:"post",
    data
  })
}

/**
 *
 */
export function getDepartmentDetail(id){
  return request({
    url:`/company/department/${id}`
  })
}
/**
 * 修改部门数据
 */
export function updateDepartment(data){
  return request({
    url:`/company/department/${data.id}`,
    method:"put",
    data
  })

}

/**
 * 删除部门
 *
 */
export function delDepartment(id){
  return request({
    url:`/company/department/${id}`,
    method:"delete"

  })
}
